﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TrailMapManager.Common.Poi;
using TrailMapManager.Communication;

namespace TrailMapManager.Common
{
    public class TrailMapCommunication : ITrailMapCommunication
    {
        public bool ConnectPhone(string phoneName, long maxSpace, long freeSpace)

        {
            return CommunicationManager.Instance.NewConnection(phoneName, maxSpace, freeSpace);
        }

        public TrailCommand GetNewCommand()
        {
            return CommunicationManager.Instance.GetNewCommand();
        }

        public void UploadMapList(List<MapInformation> maps)
        {
            CommunicationManager.Instance.AddMapList(maps);
        }


        public void UploadTrackList(TrailTrackTransfer tracks)
        {
            Track.TrailTrackManager.Instance.AddTrackList(tracks);
        }

        public void UploadPoiList(TrailPoi pois)
        {
            PoiManager.Instance.AddPoint(pois);
        }


        public FileTransferSegment GetFileSegment(FileTransferSegmentRequest request)
        {
            return CommunicationManager.Instance.GetFileSegment(request);
        }


        public void UploadTrackFinish()
        {
            Track.TrailTrackManager.Instance.UploadFinished();
        }
    }
}
